package cn.xiaoxiang.fallback;

import cn.xiaoxiang.batis.AjaxResult;
import cn.xiaoxiang.domain.Store;
import cn.xiaoxiang.feign.StoreService;
import feign.hystrix.FallbackFactory;


import org.springframework.stereotype.Component;

@Component
public class StoreServicefallbackFactory implements FallbackFactory<StoreService> {

    @Override
    public StoreService create(Throwable throwable) {

        return new StoreService() {
            @Override
            public AjaxResult add(Store store) {
                return new AjaxResult("熔断了",false,"请过后再试");
            }


        };
    }
}
